<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=no">
	<title>日新网_我的收藏</title>
	<link rel="stylesheet" href="__TMPL__Public/assets/css/bootstrap.min.css">
	<link rel="stylesheet" href="__TMPL__Public/assets/css/reset.css">
	<link rel="stylesheet" href="__TMPL__Public/assets/css/style.css">
	<script type="text/javascript" src="__TMPL__Public/assets/js/rem.js"></script>
	<style>
		.tab_nav li {
			width: 50%!important;
			text-align: center;
		}
		.hidden {
			display: none;
		}
	</style>
</head>
<body>
	<!--nav-->
	<tc_include file="Public:nav"/>
	<!--我的收藏页-->
	<div class="tab_nav " id="tab_nav">
		<ul class="comWidth clearfix">
			<a href="{:U('user/profile/mobile_self_collect', ['index' => 0])}"><li class="{$index == 0 ? 'active' : ''}">文章(<span>{$type_count[0]}</span>)</li></a>
			<a href="{:U('user/profile/mobile_self_collect', ['index' => 1])}"><li class="{$index == 1 ? 'active' : ''}">问答(<span>{$type_count[1]}</span>)</li></a>
		</ul>
	</div>
	<div id="tab_content">

		<!--文章-->
		<div class="tab_content comWidth index_content hidden">
			<volist name="lists" id="vo">
				<div class="questions_item ">
					<a href="{:U('portal/article/article_info', ['id' => $vo['id']])}">
						<p class="text1 ellipsis2">{$vo.post_title}</p>
					</a>
					<p class="text2">
						<span>{:time_format($vo['post_date'])}</span>
					</p>
				</div>
			</volist>
		</div>

		<!--问答-->
		<div class="tab_content comWidth index_content hidden">
			<volist name="lists" id="vo">
				<div class="questions_item ">
					<a href="{:U('question/question/question_info', ['id' => $vo['id']])}">
						<p class="text1 ellipsis2">{$vo.post_title}</p>
					</a>
					<p class="text2">
						<span>{:time_format($vo['post_date'])}</span>
						<span>回答(<i>{$vo.answer_count}</i>)</span>
					</p>
				</div>
			</volist>
		</div>

		<div style="height: .5rem;line-height: .5rem;background-color: #efdddd;" class="js-infinite-scroll-loading text-center">更多</div>
		<div id="nextpage"></div>
	</div>

	<!--页脚-->
	<tc_include file="Public:footer"/>

	<script type="text/javascript" src="__TMPL__Public/assets/js/jquery.1.12.4.js"></script>
	<script src="__TMPL__Public/assets/js/bootstrap.min.js" ></script>
	<script src="__TMPL__Public/assets/js/jquery.infiniteScroll.js"></script>

    <script>
        var list_index = '{$index}';
		$(function () {
			$('.index_content:eq(' + list_index + ')').removeClass('hidden').siblings().addClass('hidden');
        });

        // 加载更多
        $('#nextpage').infiniteScroll({
            loading:'.js-infinite-scroll-loading',
            total_pages:{$total_pages},
            success:function(content){
                var items = $(content).find('.index_content:eq(' + list_index + ') div');
                if(items.length > 0){
                    $('.index_content:eq(' + list_index + ')').append(items);
                }
            }
        });
	</script>

</body> 
</html>